import React, { Component } from 'react'

class ErrorBoundaries extends Component {
	state = {
		hasError: false,
	}
	componentDidCatch() {}

	static getDerivedStateFromError() {
		return {
			hasError: true,
		}
	}

	render() {
		if (this.state.hasError) {
			return <div>发生未知错误</div>
		}
		return <App />
	}
}

export default ErrorBoundaries
